#pragma once
#include "MobileObject.h"
#include "..\\..\\SGD Wrappers\\SGD_Geometry.h"

class Entity : 	public MobileObject
{
private:
	int iCurHP;
	int iMaxHP;
	float fAttackTimer;
	float fAttackResetTime;
	bool bIsAttacking;
	bool bOnGround;
	bool bJumping;
	bool bMovingLeft;
	float fInvulnerableTimer;
	bool bOnWall;
	bool bFacingLeftRight; //true = Facing Left, false = Facing Right
	bool bPreviousFacingDirection;
	bool bWallLeftRight;
	float fWallTime;
	float fPartTimer;


public:
	Entity();
	virtual ~Entity();

	int Update(float dt);
	void HandleCollision(const GameObject* collision);
	void HandleAttackCollision(const GameObject* collision);
	void TileCollision(float dt);
	bool CheckTile(int x, int y, int index);
	bool CheckTile(int x, int y, int index, int endY);

	// Accessors
	int GetCurrentHP();
	int GetMaxHP();
	bool IsAttacking();
	bool IsInvulnerable();
	float GetInvulnerableTimer();
	float GetAttackTimer();
	float GetAttackResetTime();
	bool IsOnGround();
	bool IsJumping();
	bool IsOnWall();
	bool IsOnLeftWall();
	bool IsMovingLeft();
	float GetParticleTimer();
	float GetWallTime();
	bool IsFacingLeft()const;
	bool PrevDirection();

	// Mutators
	void IsOnLeftWall(bool wall);
	void StartWallTime();
	void SetWallTime(float time);
	void SetInvulnerableTimer(float time);
	void IsOnGround(bool grounded);
	void SetCurrentHP(int iHp);
	void SetMaxHP(int iHp);
	void IsAttacking(bool attack);
	void SetAttackTimer(float time);
	void SetAttackResetTime(float time);
	void IsJumping(bool jump);
	void IsOnWall(bool wall);
	void IsMovingLeft(bool direction);
	void SetParticleTimer(float timer);
	void IsFacingLeft(bool left);
	void PrevDirection(bool prevDir);

};

